package behavioral_pattern.Interpreter_pattern;

public class SentenceNode extends AbstractMode{

    private AbstractMode direction;
    private AbstractMode action;
    private AbstractMode distance;

    public SentenceNode(AbstractMode direction, AbstractMode action, AbstractMode distance) {
        this.direction = direction;
        this.action = action;
        this.distance = distance;
    }

    @Override
    public String interpret() {
        return direction.interpret()+action.interpret()+distance.interpret();
    }
}
